home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Documents / Diagram / UW_Palettes / Gears.dpalette2 / Image4 (.txt) < prev    next >
NeXT TypedStream Data  |  1995-06-12  |  1KB  |  38 lines

  1. typedstream
  2. NXImage
  3. Object
  4. NXEPSImageRep
  5. NXImageRep
  6. iisssss
  7. [1021c]%!PS-Adobe-2.0 EPSF-2.0
  8. %%Title:Gear9.eps
  9. %%Creator: Kevin Brain (ksbrain@zeus.UWaterloo.ca)
  10. %%CreationDate: Thursday June 11 1992
  11. %%Pages: 0 1
  12. %%BoundingBox: 0 0 100 100 
  13. %%EndComments
  14. % eps drawing of a gear for Diagram palette
  15. /gears 9 store
  16. /orad 50 store    % outer radius of gear
  17. /irad 25 store        % inner radius of gear
  18. /iang {180 gears div} store    % inner angle
  19. % sides of the teeth are computed to be parallel to a line drawn
  20. % from the centre of the gear to the center of the tooth
  21. % (involves cosine law...)
  22. /mess { irad 2 exp orad 2 exp sub irad 2 exp iang cos mul sub
  23.     orad 2 exp neg div}  store
  24. /oang {1 mess 2 exp sub sqrt mess div 1 atan} def
  25. /diffby2 {iang oang sub 2 div } def
  26. orad orad translate
  27. %mess 1 lt  mess 0 gt and {0 -15 moveto (in range) show}  {0 -15 moveto (out of range) show} ifelse
  28. irad 0 moveto
  29. 1 1 gears {
  30. pop                % we don't use the value from the for
  31. 0 0 orad diffby2 dup oang add arc
  32. %0 0 orad 0 iang arc
  33. 0 0 irad iang dup 2 mul arc
  34. iang 2 mul rotate
  35. } for
  36. %0 0 moveto
  37. %(done) show
  38.